using VMukti.DataAccess.VMuktiGrid;
using VMukti.Common;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using System;
using VMuktiAPI;
//using VMukti.Business.CommonDataContracts;

namespace VMukti.Business.VMuktiGrid
{
    public class ClsTabCollection : ClsBaseCollection<ClsTab>
    {
        public static ClsTabCollection GetAll(int intPageId)
        {
            try
            {
                ClsTabCollection obj = new ClsTabCollection();
                if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp)
                {
                    obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select * from tabs where pageid=" + intPageId + " and IsDeleted='False'").dsInfo);
                }
                else
                {
                    obj.MapObjects(new ClsTabDataService().GetTabs(intPageId));
                }
                return obj;
            }
            catch (Exception ex)
            {
                ex.Data.Add("My Key", "VMukti--:--VmuktiBussiness--:--VmuktiGrid--:--Tab--:--ClsTabCollection.cs--:--GetAll()--");
                VMuktiAPI.ClsException.LogError(ex);
                ClsException.WriteToErrorLogFile(ex);
                return null;
            }
        }
    }
}
